<?php

class mainController {
	
	function __construct() {
	}
	
	public function render( $tplname, $data = array() ) {
		$tpl = App::me()->tpl;
		$tpl->assign('data', $data);
		$tpl->display($tplname.'.tpl');
	}
	
	public function index() {		
		session_start();
		
		if( !App::check_session() ) return;

		$data = array();
		$data['full_name'] = $_SESSION['full_name'];
		$data['cat_id'] = $_SESSION['cat_id'];
		$data['priv'] = json_encode( $_SESSION['priv'] );

		$this->render('main',$data);
	}
	
}
?>